package com.haizhi.storage;

import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.nio.file.Path;
import java.util.stream.Stream;

public interface StorageService {

    void storageInit();

    boolean storeUpload(MultipartFile multipartFile, String filepath, HttpServletRequest request);

    Stream<Path> loadAllDownload();

    Stream<Path> loadAllUpload(int maxDepth);

    Path loadDownload(String filename);

    void loadDownAsResource(String filename, HttpServletResponse response,
                            HttpServletRequest request);

    boolean md5InMap(Path filePath);

    String getDownFileMD5(String filename);
}
